<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        height: 3000px;
      }
      #demo {
        position: absolute;
        top: 1500px;
        width: 400px;
        height: 200px;
        border: 2px solid black;
      }
      img {
        width: 100%;
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="demo"></div>
    <script>
      const imgEl = new Image();
      imgEl.onload = function () {
        const demoEl = document.querySelector("#demo");
        demoEl.appendChild(imgEl);
      };
      imgEl.src =
        "https://picx.zhimg.com/v2-64457ff26e0aacf6903394d746c730c1_1440w.jpg";
    </script>
  </body>
</html>
